﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Family_ShortMsgResend : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void gvdata_Selected(object sender, SqlDataSourceStatusEventArgs e)
    {
        msg.Text = e.AffectedRows.ToString();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        GridViewRow gvr = gv.SelectedRow;
        if (gvr != null)
        {
            string mobile = gvr.Cells[8].Text;
            string content=gvr.Cells[6].Text;

            XJX.Page.ParamInfo pi = (XJX.Page.ParamInfo)HttpContext.Current.Session["ParamInfo"];
            if (pi == null)
            {
                pi = XJX.Page.Other.Get_ALL_Param_For_Class();
                HttpContext.Current.Session["ParamInfo"] = pi;//保持参数信息
            }

            //发送短信时，需要参数支持，所以需要上述代码支持，以获取参数。
            int i = XJX.Page.Helper.SendShortMsg(mobile,content);

            if (i == 1)
            {
                //还需要对已经发送短信成功的记录，进行标志更新。
                Response.Write("<script>alert('发送成功！')</script>");
            }
            else
            {
                Response.Write("<script>alert('发送失败！')</script>");
            }
        }
    }

}